var $ = require("jquery");

module.exports = function(){


     this.fetchData= function(model){


     	 var defer = $.Deferred();
                 model.fetch({
                  success: function(data){
                    defer.resolve(data);
                  },
                   error: function(data){
                      defer.resolve(undefined);
                    }
                });
            var promise = defer.promise();

            return promise;

     }
     
     



}